package com.chj.service;

import com.chj.dao.repository.DictionaryRepository;
import com.chj.dao.repository.UserRepository;
import com.chj.entity.DictionaryEntity;
import com.chj.entity.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryService {

    @Autowired
    private DictionaryRepository dictionaryRepository;

    public long addOne(DictionaryEntity dictionary) {
        dictionary = this.dictionaryRepository.save(dictionary);
        return dictionary.getId();
    }

    public List<DictionaryEntity> getList() {
        return this.dictionaryRepository.findAll();
    }
}
